/**
  ******************************************************************************
  * @author     Chris
  * @since      2024/6/18 16:18
  *
  * @file       pd_exti.h
  * @brief      Header file of Xxx hardware driver.
  *
  * @note       This file contains the Xxx object declaration.
  *
  * @warning    None.
  ******************************************************************************
  * Change Logs:
  *   Date          Author       Notes
  *   2024/6/18     Chris        the first version
  *
  ******************************************************************************
  */


#ifndef JLC_SKY_EXTI_H
#define JLC_SKY_EXTI_H

#include <stm32f4xx.h>
#include "pd_gpio.h"

typedef struct ExtIRDef ExtIR;

struct ExtIRDef {
    GPIO *gpio;

    uint32_t Port;
    uint32_t Line;
    uint32_t Line_0_31;
    FunctionalState LineCommand;
    uint8_t Mode;
    uint8_t Trigger;

    void (*init)(ExtIR *this, IRQn_Type irQnType, uint32_t PreemptPriority, uint32_t SubPriority);
};

extern const struct ExtIRClass {
    ExtIR *(*build)(GPIO *gpio, uint32_t Line_0_31, uint32_t Port, uint32_t Line);
} ExtIRBuilder;

#endif //JLC_SKY_EXTI_H
